<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class user_info extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -  
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in 
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see http://codeigniter.com/user_guide/general/urls.html
	 */
	public function __construct() {
		parent::__construct();
		ini_set('session.cookie_httponly',1); 
		ini_set('session.use_only_cookies',1);
		$this->load->model('user_class');
	}
	public function get_user_info(){
		$data=array();

		$post = $this->input->post();
		$userInfo = $this->user_class->get_user_data($post);
		if($userInfo!=0){
			foreach($userInfo as $key=>$value){
				$data['strEmail']=$value['strEmail'];
			}
		}
		echo json_encode($data);
	}
	public function get_user_count(){
		$post = $this->input->post();
		$userCount = $this->user_class->count_client_user($post);
		echo json_encode($userCount);
	}

	public function get_user_info_mobile(){
		$data=array();
	
		$post = $this->input->post();
		$userInfo = $this->user_class->get_user_data($post);
		if($userInfo!=0){
			foreach($userInfo as $key=>$value){
				$data['intID']=$value['intID'];
				$data['strName']=$value['strName'];
				$data['dateBirthday']=$value['dateBirthday'];
				$data['intAge']=$value['intAge'];
				$data['strEmail']=$value['strEmail'];
				$data['dateConceptionDate']=$value['dateConceptionDate'];
				$data['strPassword']=$value['strPassword'];
				$data['intAccountType']=$value['intAccountType'];
				$data['strImgLink']=$value['strImgLink'];
				$data['intDisabled']=$value['intDisabled'];
				$data['strCreatedBy']=$value['strCreatedBy'];
				$data['dateCreatedDate']=$value['dateCreatedDate'];
				$data['strModifiedBy']=$value['strModifiedBy'];
				$data['dateModifiedDate']=$value['dateModifiedDate'];
			}
		}
		echo json_encode($data);
	}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */